package com.huangliusong.desigin.pattern.creational.simplefactory;

/**
 * @author huangliusong
 * @since 2018/10/9
 * {@link }
 */
public class Test {
    public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
//        Video video=new JavaVideo();
//        video.produce();
//        video=new PythonVideo();
//        video.produce();
//        Video video=new  VideoFactory().getVideo("python");
//        video.produce();
        VideoFactory videoFactory=new VideoFactory();
        Video video=videoFactory.getVideo(PythonVideo.class);
        if (video==null){
            return ;
        }
        video.produce();


        //该方式就是通过类名加载bao，进行实例话
        Class.forName("com.mysql.jdbc.Driver");
    }
}
